package com.googlecode.spruce.plugins.core.rdbms;

public final class MySqlServiceCheck extends AbstractRdbmsServiceCheck
{
    private static final String VALIDATION_STRING = "SELECT 1";

    private static final String CONN_URL = "jdbc:mysql://";

    private String host;
    private int port;

    public MySqlServiceCheck()
    {
        super();

        this.host = "localhost";
        this.port = 3306;

        super.setValidationQuery(VALIDATION_STRING);
    }

    @Override
    protected String getConnectionURL()
    {
        return CONN_URL + this.host + ":" + this.port;
    }

    public String getHost()
    {
        return host;
    }

    public void setHost(final String host)
    {
        this.host = host;
    }

    /**
     * @return the port
     */
    public int getPort()
    {
        return port;
    }

    /**
     * @param port
     *            the port to set
     */
    public void setPort(final int port)
    {
        this.port = port;
    }
}
